<template>
    <div class="urging_manage">
        <!--催收权限管理-->
        <div class="data_list_panel">
            <!--催收员列表-->
            <account-list
                    v-show="activeTab === 'accountList'"
                    :active-tab="activeTab"
                    @searchOrder="searchOrder">
            </account-list>

            <!--催收订单-->
            <order-list
                    v-if="activeTab === 'orderList'"
                    :active-tab="activeTab"
                    :search-form="form"
                    @updateActiveTab="updateActiveTab">
            </order-list>

            <!--预催收订单-->
            <pre-order-list
                    v-if="activeTab === 'preOrderList'"
                    :active-tab="activeTab"
                    :search-form="form"
                    @updateActiveTab="updateActiveTab">
            </pre-order-list>
        </div>
    </div>
</template>

<script>
    import AccountList from './account-list';
    import OrderList from './order-list';
    import PreOrderList from './pre-order-list.vue';

    export default {
        name: 'collection-authority',
        components: {
            AccountList,
            OrderList,
            PreOrderList,
        },
        data() {
            return {
                activeTab: 'accountList',
                form: {
                    accountId: ''
                }
            };
        },
        methods: {
            updateActiveTab(val) {
                if (val) {
                    this.activeTab = val;
                }
            },
            searchOrder(form, tab) {
                this.form = Object.assign({}, form);
                if (tab) {
                    this.activeTab = tab;
                }
            },
        },
        created() {
            //
        }
    };
</script>


<style lang="scss">
    [data-page=authorityManage-collectionAuthority] {
        .tips_text {
            text-align: center;
            margin: 16px 0;
            span {
                color: red;
                text-decoration: underline;
                font-weight: bold;
            }
        }
        .popOver {
            word-break: break-all;
        }
    }
</style>

<style lang="scss" scoped>
    .data_list_panel {
        margin: 0;
    }
</style>
